package com.tyk.bookstore.back.product.model.query;

import com.tyk.bookstore.back.product.model.constant.ClazzValidateConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author tyk
 * @description 分类
 */
@Data
@Schema(name = "ClazzAddQuery", description = "分类")
public class ClazzAddQuery implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "父级ID")
    @NotNull
    @Min(value = 0)
    private Long parentId;

    @Schema(description = "名称")
    @NotBlank
    @Size(min = ClazzValidateConstant.NAME_MIN_LENGTH, max = ClazzValidateConstant.NAME_MAX_LENGTH)
    @Pattern(regexp = ClazzValidateConstant.NAME_REGEXP)
    private String name;

}
